package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IApiSettingDao;
import com.financing.platform.dto.ApiSettingDTO;
import com.financing.platform.util.SqlName;


@Repository("apiSettingDaoImpl")
public class ApiSettingDaoImpl extends BaseDaoImpl implements IApiSettingDao {

	@SuppressWarnings("unchecked")
	public List<ApiSettingDTO> apiSettingList() throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.apiSettingList);
	}

	public int addApiSetting(ApiSettingDTO apiSettingDTO) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addApiSetting, apiSettingDTO);
	}

	public int updateApiSetting(ApiSettingDTO apiSettingDTO)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updateApiSetting, apiSettingDTO);
	}

}
